package com.ruoyi.activiti.domain;

import org.activiti.engine.repository.ProcessDefinition;

/**
 * @author danghf
 * @version 1.0
 * @date 2024/05/06 15:06
 * 流程定义
 */
public class IProcessDefinition {
    /* 流程名称 */
   private String name;

   /* 流程key */
   private String key;

   /* 流程版本 */
   private int version;

   /* 类别*/
   private String category;

   /* 部署id */
   private String deploymentId;

   /* 资源名称 */
   private String resourceName;

   /* 暂停状态 */
   private boolean isSuspended;


   private String id;


    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getKey() {
        return key;
    }

    public void setKey(String key) {
        this.key = key;
    }

    public int getVersion() {
        return version;
    }

    public void setVersion(int version) {
        this.version = version;
    }

    public String getCategory() {
        return category;
    }

    public void setCategory(String category) {
        this.category = category;
    }

    public String getDeploymentId() {
        return deploymentId;
    }

    public void setDeploymentId(String deploymentId) {
        this.deploymentId = deploymentId;
    }

    public String getResourceName() {
        return resourceName;
    }

    public void setResourceName(String resourceName) {
        this.resourceName = resourceName;
    }

    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public boolean isSuspended() {
        return isSuspended;
    }

    public void setSuspended(boolean suspended) {
        isSuspended = suspended;
    }

    public static IProcessDefinition build(ProcessDefinition processDefinition){
        IProcessDefinition iProcessDefinition = new IProcessDefinition();
        iProcessDefinition.setName(processDefinition.getName());
        iProcessDefinition.setKey(processDefinition.getKey());
        iProcessDefinition.setVersion(processDefinition.getVersion());
        iProcessDefinition.setCategory(processDefinition.getCategory());
        iProcessDefinition.setDeploymentId(processDefinition.getDeploymentId());
        iProcessDefinition.setResourceName(processDefinition.getResourceName());
        iProcessDefinition.setSuspended(processDefinition.isSuspended());
        iProcessDefinition.setId(processDefinition.getId());
        return iProcessDefinition;
    }
}
